import java.util.StringTokenizer;


class P10036_39643 {

	public static void main(String[] args) {
		int cases = Integer.parseInt(readLn());
		
		for (int kase = 0; kase < cases; kase++) {
			StringTokenizer st = new StringTokenizer(readLn());
			int n = Integer.parseInt(st.nextToken());
			int k = Integer.parseInt(st.nextToken());
			
			if (n == 1) {
				int value = Integer.parseInt(readLn());
				if (value % k == 0) {
					System.out.println("Divisible");
				} else {
					System.out.println("Not divisible");
				}
			} else {
				int[] array = new int[n];
				
				st = new StringTokenizer(readLn());
				
				for (int i = 0; i < n; i++) {
					array[i] = Integer.parseInt(st.nextToken());
				}
				
				boolean[] flags1 = new boolean[k];
				
				flags1[Math.abs(array[0]) % k] = true;
				
				for (int i = 1; i < n; i++) {
					boolean[] flags2 = new boolean[k];
//					System.out.println("flags1 " + Arrays.toString(flags1));
					for (int j = 0; j < k; j++) {
						if (flags1[j]) {
							flags2[Math.abs((j + array[i])) % k] = true;
							flags2[Math.abs((j - array[i])) % k] = true;
						}
					}
//					System.out.println("flags2 " + Arrays.toString(flags2));
					
					flags1 = flags2;
				}
				
				if (flags1[0])
					System.out.println("Divisible");
				else System.out.println("Not divisible");
				
			}
			
		}
		
	}
	
	static String readLn() {
        String newLine = System.getProperty("line.separator");
        StringBuffer buffer = new StringBuffer();
        int car = -1;
        try {
            car = System.in.read();
            while ((car > 0) && (car != newLine.charAt(0))) {
                buffer.append((char)car);
                car = System.in.read();
            }
            if (car == newLine.charAt(0))
            System.in.skip(newLine.length() - 1);
        } catch (java.io.IOException e) { return (null);}
        if ((car < 0) && (buffer.length() == 0)) return (null);
        return (buffer.toString()).trim();
    }
	
}
